package com.web.servlet.utils;

import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

/**
 * 关于时间的工具类
 */
public class TimeServerUtil {
	private static final String DATE_HHMM_FORMAT = "HH:mm";

	private static ThreadLocal<DateFormat> threadLocal = new ThreadLocal<DateFormat>() {
		protected DateFormat initialValue() {
			return new SimpleDateFormat(DATE_HHMM_FORMAT);
		};
	};

	public static final long ONE_SECOND = 1000;

	public static final long ONE_MIN = 60 * ONE_SECOND;
	public static final long ONE_HOUR = 60 * ONE_MIN;
	public static final long HALF_HOUR = 30 * ONE_MIN;
	/*************************************************** 日期格式转换 ***************************************/

	public static int ms = 1;

	public static int secToMs = ms * 1000;

	public static int minToMs = secToMs * 60;

	public static int hourToMs = minToMs * 60;

	public static int dayToMs = hourToMs * 24;

	public static Date addDays(Date dt1, int days) {

		Calendar cale = Calendar.getInstance();
		cale.setTime(dt1);
		cale.add(Calendar.DATE, days);
		return cale.getTime();
	}

	/**
	 * 在一个时间的基础上添加小时后返回
	 * 
	 * @param Date
	 * @param int
	 * @return Date
	 */
	public static Date addHours(Date date, int hours) {
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		cal.roll(Calendar.HOUR, hours);
		return cal.getTime();
	}
	/**
	 * 获取系统当前时间
	 * 
	 * @return
	 */
	public static Timestamp getSysteCurTime() {
		Timestamp ts = new Timestamp(getCalendar().getTimeInMillis());
		return ts;
	}
	/**
	 * 在一个时间的基本上增加几分钟后返回
	 * 
	 * @param date
	 * @param minute
	 * @return
	 */
	public static Date addMinute(Date date, int minute) {
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		cal.roll(Calendar.MINUTE, minute);
		return cal.getTime();
	}

	public static Date addMinutes(Date date, int value) {
		Calendar cale = Calendar.getInstance();
		cale.setTime(date);
		cale.add(Calendar.MINUTE, value);
		return cale.getTime();
	}

	public static Date addMonths(Date date, int value) {

		Calendar cale = Calendar.getInstance();
		cale.setTime(date);
		cale.add(Calendar.MONTH, value);
		return cale.getTime();
	}

	public static Date addSeconds(Date date, int value) {
		Calendar cale = Calendar.getInstance();
		cale.setTime(date);
		cale.add(Calendar.SECOND, value);
		return cale.getTime();
	}

	/**
	 * 当前时间距离今天几天 now - time
	 * 
	 * @param time
	 * @return
	 */
	public static int betweenDayAbs(long time) {
		long passTime = getBeginOfDay(new Date()) - time;
		if (passTime < 0)
			return 0;
		return (int) Math.floor(passTime / dayToMs) + 1;
	}
	
	/**
	 * 当前时间距离今天几天 time - now 
	 * 
	 * @param time
	 * @return
	 */
	public static int betweenDayNatural(long time) {
		long passTime = time - getBeginOfDay(new Date()) ;
		if (passTime < 0)
			return 0;
		return (int) Math.floor(passTime / dayToMs) + 1;
	}

	/**
	 * 日期转为指定格式
	 * 
	 * @param time
	 * @param format
	 * @return
	 */
	public static String date2str(String time, DateFormat format) {
		if (time == null) {
			return "暂无";
		}
		Date date = new Date(Long.valueOf(time));
		return format.format(date);
	}
	/**
	 * 获取系统时间
	 * 
	 * @return
	 */
	private static java.util.Calendar getCalendar() {
		java.util.Calendar nowCalendar = java.util.Calendar.getInstance();
		nowCalendar.setTime(new java.util.Date());
		return nowCalendar;
	}
	/**
	 * 当前系统时间增加值
	 * 
	 * @param type
	 * @param value
	 * @return
	 */
	public static java.util.Date addSystemCurTime(int type, int value) {
		Calendar cal = getCalendar();
		switch (type) {
		case Calendar.DATE:// 增加天数
			cal.add(Calendar.DATE, value);
			break;
		case Calendar.HOUR:// 增加小时
			cal.add(Calendar.HOUR, value);
			break;
		case Calendar.MINUTE:// 增加分钟
			cal.add(Calendar.MINUTE, value);
			break;
		case Calendar.SECOND:// 增加秒
			cal.add(Calendar.SECOND, value);
			break;
		case Calendar.MILLISECOND:// 增加毫秒
			cal.add(Calendar.MILLISECOND, value);
			break;
		default:
			break;
		}
		return new java.util.Date(cal.getTimeInMillis());
	}
	/**
	 * 获取指定的时间
	 * 
	 * @param date
	 * @return
	 */
	public static java.util.Calendar getCalendar(Date date) {
		Calendar calendar = new GregorianCalendar();
		calendar.setTime(date);
		return calendar;
	}
	public static Date addTime(Date current, int type, int value) {
		Calendar cal = getCalendar(current);
		switch (type) {
		case Calendar.DATE:// 增加天数
			cal.add(Calendar.DATE, value);
			break;
		case Calendar.HOUR:// 增加小时
			cal.add(Calendar.HOUR, value);
			break;
		case Calendar.MINUTE:// 增加分钟
			cal.add(Calendar.MINUTE, value);
			break;
		case Calendar.SECOND:// 增加秒
			cal.add(Calendar.SECOND, value);
			break;
		case Calendar.MILLISECOND:// 增加毫秒
			cal.add(Calendar.MILLISECOND, value);
			break;
		default:
			break;
		}
		return new java.util.Date(cal.getTimeInMillis());
	}
	/**
	 * 获取当天开始的时刻
	 * 
	 * @param now
	 * @return
	 */
	public static long getBeginOfDay(Date now) {
		Calendar cal = Calendar.getInstance();
		cal.setTime(now);
		cal.set(Calendar.HOUR_OF_DAY, 0);
		cal.set(Calendar.MINUTE, 0);
		cal.set(Calendar.SECOND, 0);
		cal.set(Calendar.MILLISECOND, 0);
		return cal.getTimeInMillis();
	}

	/**
	 * 获取本周开始的时刻
	 * 
	 * @param now
	 * @return
	 */
	public static Date getBeginOfWeek(Date now) {
		Calendar cal = Calendar.getInstance();
		cal.setTime(now);
		cal.setFirstDayOfWeek(Calendar.MONDAY);
		cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
		cal.set(Calendar.HOUR_OF_DAY, 0);
		cal.set(Calendar.MINUTE, 0);
		cal.set(Calendar.SECOND, 0);
		cal.set(Calendar.MILLISECOND, 0);
		return cal.getTime();
	}

	public static DateFormat getDateHHMMFormat() {
		return threadLocal.get();
	}

	/**
	 * 根据日期转成整型
	 * 
	 * @param date
	 * @return
	 */
	public static int getDateInt(Date date) {
		SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
		String dateStr = formatter.format(date);
		return Integer.parseInt(dateStr);
	}

	public static long getDayZeroToMillis() {
		Calendar calendar = Calendar.getInstance();

		calendar.set(Calendar.HOUR_OF_DAY, 0);
		calendar.set(Calendar.MINUTE, 0);
		calendar.set(Calendar.SECOND, 0);
		calendar.set(Calendar.MILLISECOND, 0);
		calendar.add(Calendar.DAY_OF_MONTH, 0);
		// long ct = calendar.getTimeInMillis();

		return calendar.getTimeInMillis();
	}

	public static long getDayZeroToMillis(int specialDay) {
		Calendar calendar = Calendar.getInstance();

		calendar.set(Calendar.HOUR_OF_DAY, 0);
		calendar.set(Calendar.MINUTE, 0);
		calendar.set(Calendar.SECOND, 0);
		calendar.set(Calendar.MILLISECOND, 0);
		calendar.set(Calendar.DAY_OF_MONTH, specialDay);
		// long ct = calendar.getTimeInMillis();

		return calendar.getTimeInMillis();
	}

	/**
	 * 获得两个时间相差的分钟数
	 * 
	 * @param one
	 * @param two
	 * @return
	 */
	public static int getDifferMin(Date one, Date two) {
		if (null == one || null == two) {
			return 0;
		}
		return (int) ((two.getTime() - one.getTime()) / (1000 * 60));
	}

	/**
	 * 获得两个时间相差的妙数
	 * 
	 * @param one
	 * @param two
	 * @return
	 */
	public static int getDifferSec(Date one, Date two) {
		if (null == one || null == two) {
			return 0;
		}
		return (int) ((two.getTime() - one.getTime()) / (1000));
	}

	/**
	 * 获得一个时间到现在相差的妙数
	 * 
	 * @param one
	 * @param two
	 * @return
	 */
	public static int getDifferSecFromNow(Date one) {
		Date two = new Date();
		if (null == one) {
			return 0;
		}
		return (int) ((two.getTime() - one.getTime()) / (1000));
	}

	// 获得当前日期与本周日相差的天数
	private static int getMondayPlus() {
		Calendar cale = Calendar.getInstance();
		cale.setTime(new Date());
		// 获得今天是一周的第几天，星期日是第一天，星期二是第二天......
		int dayOfWeek = cale.get(Calendar.DAY_OF_WEEK) - 1; // 因为按中国礼拜一作为第一天所以这里减1

		if (dayOfWeek == 1) {
			return 0;
		} else {
			return 1 - dayOfWeek;
		}
	}

	/**
	 * 当前时间
	 */
	public static long getTimeNow() {
		return System.currentTimeMillis();
	}

	// public static long getTimeNow() {
	// return Calendar.getInstance().getTimeInMillis();
	// }

	/**
	 * 今天凌晨时间
	 */
	public static long getTodayBeginTime() {

		Calendar cal = Calendar.getInstance();
		cal.set(Calendar.HOUR_OF_DAY, 0);
		cal.set(Calendar.MINUTE, 0);
		cal.set(Calendar.SECOND, 0);
		cal.set(Calendar.MILLISECOND, 0);
		return cal.getTimeInMillis();
	}

	public static Date headOfDate(Date date) {
		Calendar cale = Calendar.getInstance();
		cale.setTime(date);
		cale.set(Calendar.HOUR_OF_DAY, 0);
		cale.set(Calendar.MINUTE, 0);
		cale.set(Calendar.SECOND, 0);
		cale.set(Calendar.MILLISECOND, 0);
		return cale.getTime();
	}

	/** 当前小时开始时间 */
	public static Date headOfHour() {
		Date date = new Date();
		Calendar cale = Calendar.getInstance();
		cale.setTime(date);
		cale.set(Calendar.MINUTE, 0);
		cale.set(Calendar.SECOND, 0);
		cale.set(Calendar.MILLISECOND, 0);
		return cale.getTime();
	}

	public static Date headOfMonth() {
		Calendar cale = Calendar.getInstance();
		cale.setTime(new Date());
		cale.set(Calendar.DATE, 1);// 设为当前月的1号
		cale.set(Calendar.HOUR_OF_DAY, 0);
		cale.set(Calendar.MINUTE, 0);
		cale.set(Calendar.SECOND, 0);
		cale.set(Calendar.MILLISECOND, 0);
		return cale.getTime();
	}

	public static Date headOfMonth(int month) {
		Calendar cale = Calendar.getInstance();
		cale.setTime(new Date());
		cale.set(Calendar.MONTH, month - 1);
		cale.set(Calendar.DATE, 1);// 设为当前月的1号
		cale.set(Calendar.HOUR_OF_DAY, 0);
		cale.set(Calendar.MINUTE, 0);
		cale.set(Calendar.SECOND, 0);
		cale.set(Calendar.MILLISECOND, 0);
		return cale.getTime();
	}

	public static Date headOfMonth(int year, int month) {
		Calendar cale = Calendar.getInstance();
		cale.set(Calendar.YEAR, year);
		cale.set(Calendar.MONTH, month - 1);
		cale.set(Calendar.DATE, 1);// 设为当前月的1号
		cale.set(Calendar.HOUR_OF_DAY, 0);
		cale.set(Calendar.MINUTE, 0);
		cale.set(Calendar.SECOND, 0);
		cale.set(Calendar.MILLISECOND, 0);
		return cale.getTime();
	}

	/** 获取今天的开始日期 */
	public static Date headOfToday() {
		Date date = new Date();
		return headOfDate(date);
	}

	public static Date headOfYear() {
		Calendar cale = Calendar.getInstance();
		cale.setTime(new Date());
		cale.set(Calendar.MONTH, 0);
		cale.set(Calendar.DATE, 1);// 设为当前月的1号
		cale.set(Calendar.HOUR_OF_DAY, 0);
		cale.set(Calendar.MINUTE, 0);
		cale.set(Calendar.SECOND, 0);
		cale.set(Calendar.MILLISECOND, 0);
		return cale.getTime();
	}

	public static Date headOfYear(int year) {
		Calendar cale = Calendar.getInstance();
		cale.set(Calendar.YEAR, year);
		cale.set(Calendar.MONTH, 0);
		cale.set(Calendar.DATE, 1);// 设为当前月的1号
		cale.set(Calendar.HOUR_OF_DAY, 0);
		cale.set(Calendar.MINUTE, 0);
		cale.set(Calendar.SECOND, 0);
		cale.set(Calendar.MILLISECOND, 0);
		return cale.getTime();
	}

	/**
	 * 是否同一天
	 * 
	 * @param date1
	 * @param date2
	 * @return
	 */
	public static boolean isSameDate(Date date1, Date date2) {
		Calendar c1 = Calendar.getInstance();
		c1.setTime(date1);
		Calendar c2 = Calendar.getInstance();
		c2.setTime(date2);
		return c1.get(Calendar.YEAR) == c2.get(Calendar.YEAR)
				&& c1.get(Calendar.MONTH) == c2.get(Calendar.MONTH)
				&& c1.get(Calendar.DATE) == c2.get(Calendar.DATE);
	}

	/**
	 * 获取周一日期(-1,0,1) -1表示上周 0 表示本周 1 表示下周
	 */
	public static int lastWeekMon(int n) {
		Calendar cal = Calendar.getInstance();
		cal.setFirstDayOfWeek(Calendar.MONDAY);
		// 当前日期后7天的日期
		if (n != 0)
			cal.add(Calendar.DATE, n * 7);
		cal.set(Calendar.HOUR_OF_DAY, 0);// 24小时制
		cal.set(Calendar.MINUTE, 0);
		cal.set(Calendar.SECOND, 0);
		cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
		// Date date=cal.getTime();
		// return cal.getTime();
		// Date date=cal.getTime();
		return (int) (cal.getTimeInMillis() / 1000);
	}

	/**
	 * 获取周一日期(-1,0,1) -1表示上周 0 表示本周 1 表示下周
	 */
	public static Date lastWeekMonDate(int n) {
		Calendar cal = Calendar.getInstance();
		cal.setFirstDayOfWeek(Calendar.MONDAY);
		// 当前日期后7天的日期
		if (n != 0)
			cal.add(Calendar.DATE, n * 7);
		cal.set(Calendar.HOUR_OF_DAY, 0);
		cal.set(Calendar.MINUTE, 0);
		cal.set(Calendar.SECOND, 0);
		cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
		Date date = cal.getTime();
		// System.out.println("---"+date.getTime());
		return date;
	}

	/**
	 * 获取周日日期(-1,0,1) -1表示上周 0 表示本周 1 表示下周
	 */
	public static int lastWeekSum(int n) {
		Calendar cal = Calendar.getInstance();
		cal.setFirstDayOfWeek(Calendar.MONDAY);
		cal.add(Calendar.DATE, n * 7);
		cal.set(Calendar.HOUR_OF_DAY, 23);
		cal.set(Calendar.MINUTE, 59);
		cal.set(Calendar.SECOND, 59);
		cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
		// Date date=cal.getTime();
		// return date;
		return (int) (cal.getTimeInMillis() / 1000);
	}

	//
	/**
	 * 获取周日日期(-1,0,1) -1表示上周 0 表示本周 1 表示下周
	 */
	public static Date lastWeekSumDate(int n) {
		Calendar cal = Calendar.getInstance();
		cal.setFirstDayOfWeek(Calendar.MONDAY);
		cal.add(Calendar.DATE, n * 7);
		cal.set(Calendar.HOUR_OF_DAY, 23);// 24小时制
		cal.set(Calendar.MINUTE, 59);
		cal.set(Calendar.SECOND, 59);
		cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
		Date date = cal.getTime();
		return date;
		// return (int)(cal.getTimeInMillis()/1000);
	}

	/** 获取本周开始第一天（星期一） */
	public static Date monDayOfWeek() {
		int mondayPlus = getMondayPlus();
		GregorianCalendar cale = new GregorianCalendar();
		cale.setTime(new Date());
		cale.add(GregorianCalendar.DATE, mondayPlus);
		cale.set(Calendar.HOUR_OF_DAY, 0);
		cale.set(Calendar.MINUTE, 0);
		cale.set(Calendar.SECOND, 0);
		cale.set(Calendar.MILLISECOND, 0);
		Date monday = cale.getTime();

		return monday;
	}

	/**
	 * 字符串转日期，格式错误就返回null
	 * 
	 * @param date
	 * @param sdf
	 * @return
	 */
	public static Date parseDate(String date, SimpleDateFormat sdf) {
		try {
			return sdf.parse(date);
		} catch (Exception e) {
			return null;
		}
	}

	/**
	 * 返回距离开始时间begin passDate后的凌晨时间点 例如x月1日，过7天后，就是返回8日的0点
	 * 
	 * @param begin
	 * @param passDate
	 * @return
	 */
	public static Date passTime(Date begin, int passDate) {
		// 先将开始时间设为0点
		Calendar beginTime = Calendar.getInstance();
		beginTime.setTime(begin);
		beginTime.set(Calendar.HOUR_OF_DAY, 0);
		beginTime.set(Calendar.MINUTE, 0);
		beginTime.set(Calendar.SECOND, 0);

		beginTime.add(Calendar.DATE, passDate);
		return beginTime.getTime();
	}

	public static Date sunDayOfWeek() {
		int mondayPlus = getMondayPlus();
		GregorianCalendar cale = new GregorianCalendar();
		cale.setTime(new Date());
		cale.add(GregorianCalendar.DATE, mondayPlus - 1);
		cale.set(Calendar.HOUR_OF_DAY, 0);
		cale.set(Calendar.MINUTE, 0);
		cale.set(Calendar.SECOND, 0);
		cale.set(Calendar.MILLISECOND, 0);
		Date monday = cale.getTime();
		return monday;
	}

	public static Date tailOfDate(Date date) {
		return addSeconds(addDays(headOfDate(date), 1), -1);
	}

	public static Date tailOfMonth() {
		Calendar cale = Calendar.getInstance();
		cale.setTime(new Date());
		cale.set(Calendar.DATE, 1);// 设为当前月的1号
		cale.set(Calendar.HOUR_OF_DAY, 0);
		cale.set(Calendar.MINUTE, 0);
		cale.set(Calendar.SECOND, 0);
		cale.set(Calendar.MILLISECOND, 0);
		cale.add(Calendar.MONTH, 1);// 加一个月，变为下月的1号
		cale.add(Calendar.DATE, -1);// 减去一天，变为当月最后一天
		return cale.getTime();
	}

	public static Date tailOfMonth(int month) {
		Calendar cale = Calendar.getInstance();
		cale.setTime(new Date());
		cale.set(Calendar.DATE, 1);// 设为当前月的1号
		cale.set(Calendar.MONTH, month - 1);
		cale.set(Calendar.HOUR_OF_DAY, 0);
		cale.set(Calendar.MINUTE, 0);
		cale.set(Calendar.SECOND, 0);
		cale.set(Calendar.MILLISECOND, 0);
		cale.add(Calendar.MONTH, 1);// 加一个月，变为下月的1号
		cale.add(Calendar.DATE, -1);// 减去一天，变为当月最后一天
		return cale.getTime();
	}

	public static Date tailOfMonth(int year, int month) {
		Calendar cale = Calendar.getInstance();
		cale.set(Calendar.DATE, 1);// 设为当前月的1号
		cale.set(Calendar.YEAR, year);
		cale.set(Calendar.MONTH, month - 1);
		cale.set(Calendar.HOUR_OF_DAY, 0);
		cale.set(Calendar.MINUTE, 0);
		cale.set(Calendar.SECOND, 0);
		cale.set(Calendar.MILLISECOND, 0);
		cale.add(Calendar.MONTH, 1);// 加一个月，变为下月的1号
		cale.add(Calendar.DATE, -1);// 减去一天，变为当月最后一天
		return cale.getTime();
	}

	public static Date tailOfToday() {
		return addSeconds(addDays(headOfToday(), 1), -1);
	}

	public static Date tailOfWeek() {
		int mondayPlus = getMondayPlus();
		GregorianCalendar cale = new GregorianCalendar();
		cale.add(GregorianCalendar.DATE, mondayPlus + 6);
		cale.set(Calendar.HOUR_OF_DAY, 0);
		cale.set(Calendar.MINUTE, 0);
		cale.set(Calendar.SECOND, 0);
		cale.set(Calendar.MILLISECOND, 0);
		Date monday = cale.getTime();
		return monday;
	}

	public static Date tailOfYear() {
		Calendar cale = Calendar.getInstance();
		cale.setTime(new Date());
		cale.set(Calendar.DATE, 1);
		cale.set(Calendar.MONTH, 0);// 1月1号
		cale.set(Calendar.HOUR_OF_DAY, 0);
		cale.set(Calendar.MINUTE, 0);
		cale.set(Calendar.SECOND, 0);
		cale.set(Calendar.MILLISECOND, 0);
		cale.add(Calendar.YEAR, 1);
		cale.add(Calendar.DATE, -1);// 减去一天，变为当月最后一天
		return cale.getTime();
	}

	public static Date tailOfYear(int year) {
		Calendar cale = Calendar.getInstance();
		cale.set(Calendar.YEAR, year + 1);
		cale.set(Calendar.DATE, 1);
		cale.set(Calendar.MONTH, 0);// 1月1号
		cale.set(Calendar.HOUR_OF_DAY, 0);
		cale.set(Calendar.MINUTE, 0);
		cale.set(Calendar.SECOND, 0);
		cale.set(Calendar.MILLISECOND, 0);
		cale.add(Calendar.DATE, -1);// 减去一天，变为当月最后一天
		return cale.getTime();
	}
	/**
	 * <pre>
	 * 比较日期是否同一天(注意：分界线为晚上 12 点)
	 * </pre>
	 * 
	 * @param date
	 * @return
	 */
	public static boolean dateCompare(Date date) {
		if (date == null)
			return false;
		java.util.Calendar now = getCalendar();
		java.util.Calendar other = getCalendar(date);
		return dateCompare(now, other) == 0 ? true : false;
	}
	/**
	 * 返回两个日期相差天数
	 * 
	 * @param startDate
	 *            开始日期
	 * @param endDate
	 *            结束日期
	 * @return
	 */
	public static int dateCompare(java.util.Calendar startDate,
			java.util.Calendar endDate) {
		startDate.set(Calendar.HOUR_OF_DAY, 0);
		startDate.set(Calendar.MINUTE, 0);
		startDate.set(Calendar.SECOND, 0);
		startDate.set(Calendar.MILLISECOND, 0);

		endDate.set(Calendar.HOUR_OF_DAY, 0);
		endDate.set(Calendar.MINUTE, 0);
		endDate.set(Calendar.SECOND, 0);
		endDate.set(Calendar.MILLISECOND, 0);

		int day = (int) (endDate.getTimeInMillis() / 1000 / 60 / 60 / 24 - startDate
				.getTimeInMillis() / 1000 / 60 / 60 / 24);
		return day;
	}
	/**
	 * 比较日期是否是同一个月份
	 * 
	 * @param date
	 *            被比较的日期
	 * @return
	 */
	public static boolean monthCompare(Date date) {// 一年之内是否是同一个月
		if (date == null)
			return false;
		java.util.Calendar now = getCalendar();
		java.util.Calendar other = getCalendar(date);
		int nowMonth = now.get(Calendar.MONTH) + 1;
		int otherMonth = other.get(Calendar.MONTH) + 1;
		return (otherMonth - nowMonth) == 0 ? true : false;
	}
}
